home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
_PD_TOOLS_MARQ.pdrx
< prev
next >
Wrap
Text File
|
1992-06-22
|
6KB
|
269 lines
/*
@N
*/
msg = PDSetup.rexx(2,0)
units = getclip(pds_units)
if msg ~= 1 then exit_msg(msg)
cr = '0a'x
objlist.1 = "isclosed"
objlist.1.1 = "Close objects"
objlist.2 = "islocked"
objlist.2.1 = "Locked Objects"
objlist.3 = "isgrouped"
objlist.3.1 = "Grouped Objects"
objlist.4 = "iscompound"
objlist.4.1 = "Compounded Objects"
objlist.5 = "isbitmap"
objlist.5.1 = "Bitmap Objects"
objlist.6 = "isepsf"
objlist.6.1 = "EPSF objects"
objlist.7 = "isstructgraphic"
objlist.7.1 = "Structured Graphics objects"
objlist.8 = "isellipse"
objlist.8.1 = "Ellipses"
objlist.9 = "iscircle"
objlist.9.1 = "Circles"
objlist.10 = "isbezier"
objlist.10.1 = "Beziers"
objlist.11 = "isgrid"
objlist.11.1 = "Grid Objects"
objlist.12 = "istext"
objlist.12.1 = "Text Objects"
objlist.13 = "istexthole"
objlist.13.1 = "Text Holes"
objlist.14 = "istransparent"
objlist.14.1 = "Transparent Objects"
objlist.15 = "ishidden"
objlist.15.1 = "Hidden objects"
objlist = ''
do i = 1 to 15
objlist = objlist || cr || objlist.i.1
interpret compress(objlist.i.1)"="objlist.i
end
objlist = substr(objlist, 2)
selection = "By Size"cr"By Position"cr"By Color"cr"By Layer"cr"By Object Type"
selection = pdm_SelectFromList("Select object..", 20, 5,1,selection)
if selection = '' then exit_msg()
i = 0
do while selection ~= ''
parse var selection function '0a'x selection
function = compress(function)
i = i + 1
interpret vfunc.i" = "function"()"
end
if pdm_SelFirstObj() ~ = 0 then
do
if ~pdm_Inform(2,"Add objects to current selection?", "No", "Yes") then
call pdm_UnSelectobj()
end
cobj = pdm_PageFirstobj()
num = 0
do while cobj ~= 0
switch = 1
num = num + 1
do x = 1 to i
interpret "rval = "vfunc.x
switch = switch & rval
if ~rval then break
end
if switch then call pdm_SelectAnother(cobj)
cobj = pdm_PageNextObj(cobj)
end
exit_msg()
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then call pdm_Inform(1,message,)
call pdm_AutoUpdate(1)
call pdm_SetUnits(units)
exit
end
CheckSize: procedure expose cobj units
do
parse arg minw, minh, maxw, maxh
size = pdm_GetObjVisSize(cobj)
width = word(size, 1)
height = word(size, 2)
if ((width >= minw) & (width <= maxw)) & ((height >= minh) & (height <= maxh)) then
return(1)
else
return(0)
end
CheckPos: procedure expose cobj units
do
parse arg left, top, right, bottom
pos = pdm_GetObjVisPosn(cobj)
size = pdm_GetObjVisSize(cobj)
l = word(pos, 1)
t = word(pos, 2)
r = word(size, 1) + l
b = word(size, 2) + t
if (l >= left) & (r <= right) & (t >= top) & (b <= bottom) then
return(1)
return(0)
end
BySize: procedure expose units
do
cr = '0a'x
form = "Min Width"cr"Min Height"cr"Max Width"cr"Max Height"
size = pdm_GetForm("Enter object size..", 8, form)
if size = '' then exit_msg()
parse var size minw '0a'x minh '0a'x maxw '0a'x maxh
if ~(datatype(minw, n) & datatype(minh, n) & datatype(maxw, n) & datatype(maxh, n)) then
exit_msg("Invalid Entry")
if units >2 then
do
minw = pdm_ConvertUnits(units, 1, minw)
minh = pdm_ConvertUnits(units, 1, minh)
maxw = pdm_ConvertUnits(units, 1, maxw)
maxh = pdm_ConvertUnits(units, 1, maxh)
end
return "CheckSize("minw","minh","maxw","maxh")"
end
ByPosition: procedure expose units
do
cr = '0a'x
form = "Left"cr"Top"cr"Right"cr"Bottom"
size = pdm_GetForm("Enter object boundry..", 8, form)
if size = '' then exit_msg()
parse var size minw '0a'x minh '0a'x maxw '0a'x maxh
if ~(datatype(minw, n) & datatype(minh, n) & datatype(maxw, n) & datatype(maxh, n)) then
exit_msg("Invalid Entry")
if units >2 then
do
minw = pdm_ConvertUnits(units, 1, minw)
minh = pdm_ConvertUnits(units, 1, minh)
maxw = pdm_ConvertUnits(units, 1, maxw)
maxh = pdm_ConvertUnits(units, 1, maxh)
end
return "CheckPos("minw","minh","maxw","maxh")"
end
ByColor: procedure expose colorlist units
do
lc = pdm_GetLineColor()
clist = pdm_SetLineColor()
call pdm_SetLineColor(,lc)
if clist = '' then exit_msg()
return("CheckColor('"clist"')")
end
CheckColor: procedure expose cobj units
do
parse arg clist
if pdm_GetLineWeight(cobj) ~= 0 & pos(pdm_GetLineColor(cobj), clist) ~= 0 then return(1)
fpattern = pdm_GetFillPattern(cobj)
parse var fpattern type '0a'x c1 '0a'x c2 '0a'x junk
if type = 0 then return(0)
if type >= 1 & pos(c1, clist) ~= 0 then return(1)
if type > 1 & pos(c2, clist) ~= 0 then return(1)
return(0)
end
ByObjectType: units
do
types = pdm_SelectFromList("Types of objects..", 20, 8, 1, objlist)
if types = '' then exit_msg()
typelist = ''
do while types ~= ''
parse var types type '0a'x types
type = value(compress(type))
typelist = typelist" "type
end
return("CheckType('"typelist"')")
end
CheckType: procedure expose cobj units
do
parse arg types
do w = 1 to words(types)
wrd = word(types, w)
interpret "rval = "wrd"("cobj")"
if rval then return(1)
end
return(0)
end
ByLayer: procedure expose units
do
cr = '0a'x
max = pdm_NumPageObjs()
form = "From:1"cr"To:"max
layers = pdm_GetForm("Enter object layer range..", 8, form)
if layers = '' then exit_msg()
parse var layers from '0a'x tolayer
if ~(datatype(from, n) & datatype(tolayer, n)) then
exit_msg("Invalid Entry")
if from < 1 | from > max | tolayer < 1 | tolayer > max then
exit_msg("Invalid Entry")
if tolayer < from then
do
temp = from
form = tolayer
tolayer = temp
end
return("CheckLayer("from","tolayer")")
end
CheckLayer: procedure expose num units
do
parse arg from, tolayer
return(num >= from & num <= tolayer)
end